package testClasses.misc;

import events.view.InitViewEvent;
import gameAppLayer.ExternalData;

import java.io.FileNotFoundException;
import java.io.IOException;

import stars.StarController;
import stars.StarGenerator;
import testClasses.ATest;
import testClasses.TestingSystem;
import utilities.ExternalDataLoader;

public class StarMaterialTest extends ATest {

	public StarMaterialTest(TestingSystem system) {
		super(system);
		this.name = "StarMaterialTest";
	}

	@Override
	public boolean execute() throws FileNotFoundException, IOException,
			ClassNotFoundException {
		
		ExternalDataLoader dataLoader = new ExternalDataLoader();
		dataLoader.execute();
		ExternalData data = dataLoader.getData();
		
		
		
		
		
		StarGenerator starGen = new StarGenerator(eventManager, assetManager, data.getStarParameters(), assetMap);
		StarController controller = starGen.createSingleStar("MSYellowWhite");
		
		controllerMap.put(controller.getKey(), controller);
		
		eventManager.queueEvent(new InitViewEvent(controller.getKey(), app.getRootNode()));
		
		return false;
	}

}
